home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / ole2book.zip / BASICS.ZIP / INC / DEBUG.H < prev    next >
C/C++ Source or Header  |  1993-03-16  |  2KB  |  82 lines

  1. /*
  2.  * DEBUG.H
  3.  *
  4.  * Definitions, structures, types, and function prototypes for debugging
  5.  * purposes.
  6.  *
  7.  * Copyright (c)1993 Microsoft Corporation, All Rights Reserved
  8.  *
  9.  * Kraig Brockschmidt, Software Design Engineer
  10.  * Microsoft Systems Developer Relations
  11.  *
  12.  * Internet  :  kraigb@microsoft.com
  13.  * Compuserve:  INTERNET>kraigb@microsoft.com
  14.  
  15.  */
  16.  
  17. #ifndef _DEBUG_H
  18. #define _DEBUG_H
  19.  
  20. #ifdef DEBUG
  21.  
  22. //Basic debug macros
  23. #define D(x)              {x;}
  24. #define ODS(x)            D(OutputDebugString(x);OutputDebugString("\r\n"))
  25.  
  26. #define ODSsz(f, s)       {\
  27.                           char szDebug[128];\
  28.                           wsprintf(szDebug, f, (LPSTR)s);\
  29.                           ODS(szDebug);\
  30.                           }
  31.  
  32.  
  33. #define ODSu(f, u)        {\
  34.                           char szDebug[128];\
  35.                           wsprintf(szDebug, f, (UINT)u);\
  36.                           ODS(szDebug);\
  37.                           }
  38.  
  39.  
  40. #define ODSlu(f, lu)      {\
  41.                           char szDebug[128];\
  42.                           wsprintf(szDebug, f, (DWORD)lu);\
  43.                           ODS(szDebug);\
  44.                           }
  45.  
  46. #define ODSlulu(f, l1,l2) {\
  47.                           char szDebug[128];\
  48.                           wsprintf(szDebug, f, (DWORD)l1, (DWORD)l2);\
  49.                           ODS(szDebug);\
  50.                           }
  51.  
  52. #define ODSszu(f, s, u)   {\
  53.                           char szDebug[128];\
  54.                           wsprintf(szDebug, f, (LPSTR)s, (UINT)u);\
  55.                           ODS(szDebug);\
  56.                           }
  57.  
  58.  
  59. #define ODSszlu(f, s, lu) {\
  60.                           char szDebug[128];\
  61.                           wsprintf(szDebug, f, (LPSTR)s, (DWORD)lu);\
  62.                           ODS(szDebug);\
  63.                           }
  64.  
  65.  
  66. #else   //!DEBUG
  67.  
  68. #define D(x)
  69. #define ODS(x)
  70.  
  71. #define ODSsz(f, s)
  72. #define ODSu(f, u)
  73. #define ODSlu(f, lu)
  74. #define ODSlulu(f, l1,l2)
  75. #define ODSszu(f, s, u)
  76. #define ODSszlu(f, s, lu)
  77.  
  78.  
  79. #endif //!DEBUG
  80.  
  81. #endif //_DEBUG_H
  82.